<!-- Begin of titlebar/breadcrumbs -->
<div id="title-bar">
	<ul id="breadcrumbs">
		<li><a href="index.php" title="Home"><span id="bc-home"></span></a></li>
		<li class="no-hover"><a href="index.php?module=user_manager">User Manager</a></li>
	</ul>
</div> <!--! end of #title-bar -->

<div class="shadow-bottom shadow-titlebar"></div>
<!-- Begin of #main-content -->
<div id="main-content">
	<div class="container_12">

		<div class="grid_12">
			<h1>User Manager</h1>
			<p>You can edit, add and delete users and edit user authorityes.</p>
			<div>
				<a class="close-toolbox button" href="index.php?module=create_user"><img src="img/icons/packs/fugue/24x24/plus-circle.png" width="15"> Create User</a>
			</div>
		</div>

		<?php
			if($showPage == false)
			{
			?>
			<div class="alert error"><strong>Error!</strong> you cant login this page!.</div>
			<?php
			}
			else
			{
			?>
			<div class="grid_12">
				<div class="block-border">
					<div class="block-header">
						<h1>User Manager</h1><span></span>
					</div>
					<div class="block-content">
						<table id="table-example" class="table">
							<thead>
								<tr>
									<th>User Name</th>
									<th>Name Surname</th>
									<th>Group</th>
									<th>Constituent</th>
									<th>Edit</th>
									<th>Delete</th>
								</tr>
							</thead>
							<tbody>
								<?php
									foreach($users as $user)
									{
									?>
									<tr class="gradeX">
										<td><?php echo $user['user_name']; ?></td>
										<td class="center"><?php echo $user['name_surname']; ?></td>
										<td class="center"><?php if($user['group_name'] != ''){echo $user['group_name'];}else{echo 'Block User';}; ?></td>
										<td class="center"><?php if($user['constituent'] != ''){ echo $user['constituent']; }else{echo '<b>Null</b> Senior Developer'; } ?></td>
										<td class="center">
											<a href="index.php?module=edit_user&user_id=<?php echo $user['id']; ?>"><img src="img/icons/packs/fugue/24x24/edit.png" width="10"> Edit User</a>
										</td>
										<td class="center">
											<a href="index.php?module=delete_user&user_id=<?php echo $user['id']; ?>" onclick="return confirm('Are you sure you want to delete this user?')"><img src="img/icons/packs/fugue/24x24/minus-circle.png" width="15"> Delete User</a>
										</td>
									</tr>
									<?php
									}  
								?>
							</tbody>
						</table>
					</div>
				</div>
			</div>

			<div class="clear height-fix"></div>
			<?php } ?>	
	</div></div> 
		<!--! end of #main-content -->
<script type="text/javascript">
	$().ready(function() {
		
		
		/*
		 * DataTables
		 */
		$('#table-example').dataTable();
		
	});
</script>